#include<bits/stdc++.h>
using namespace std;
const int N=200005;

int n,m;
struct Node{
    int t,num;
    Node(){}
    Node(int t,int num){
        this->t=t;
        this->num=num;
    }
    bool operator<(const Node& node) const{
        return t<node.t;
    }
};
set<Node> myset[N];
char line[N];
char point[N];
bool visit[N];

void dfs(int s){
    char c=point[s];
    for(auto node:myset[s]){
        int t=node.t;
        if(!visit[t]){
            point[t] = line[node.num] = (c=='R'?'B':'R');
            visit[t]=true;
            dfs(t);
            point[s] = point[t];
        }
    }
}
int main(){
    scanf("%d%d",&n,&m);
    memset(line,'G',sizeof(line));
    for(int i=0;i<m;i++){
        int s,t;
        scanf("%d%d",&s,&t);
        myset[s].insert(Node(t,i));
        myset[t].insert(Node(s,i));
    }
    memset(visit,0,sizeof(visit));
    for(int i=1;i<=n;i++){
        if(!visit[i]){
            visit[i]=true;
            point[i]='B';
            dfs(i);
        }
    }
    for(int i=0;i<m;i++){
        printf("%c",line[i]);
    }
    return 0;
}
